<?php
echo '<pre>';
$list = array (
    array('Name', 'Email','Phone','Address'),
    array('PHP', 'zeev@zend.com', '9889898989','N0ida'),
    array('PHP2', 'zeev@zend.com2', '98898989892','N0ida2'),
    array('aaa', 'bbb')
);
//var_export($list);
$fp = fopen('file.csv', 'w');

foreach ($list as $fields) {
    fputcsv($fp, $fields, ',');

}

fclose($fp);
